import React, { Component } from 'react'
import { Switch, Route, NavLink } from "react-router-dom";
import Home from "../home/home";
import Shop from "../shop/shop";
import Cate from "../cate/cate";
import Mine from "../mine/mine";
import "./Index.less";

export default class login extends Component {
    render() {
        return (
            <div className="body">
                <Switch>
                    <Route path="/index/home" component={Home}></Route>
                    <Route path="/index/cate" component={Cate}></Route>
                    <Route path="/index/shop" component={Shop}></Route>
                    <Route path="/index/mine" component={Mine}></Route>
                </Switch>

                <footer className="footer">
                    <NavLink activeClassName="select" to="/index/home">
                        <span>首页</span>
                    </NavLink>
                    <NavLink activeClassName="select" to="/index/cate">
                        <span>分类</span>
                    </NavLink>
                    <NavLink activeClassName="select" to="/index/shop">
                        <span>购物车</span>
                    </NavLink>
                    <NavLink activeClassName="select" to="/index/mine">
                        <span>我的</span>
                    </NavLink>
                </footer>
            </div>
        )
    }
}
